﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Zeenck.Models.Basic>" %>

<fieldset>
<legend>Basic Information</legend>
<%: Html.EditorForModel() %>

    <div class="editor-label">
        <%:Html.LabelFor(model => model.Interests) %> 
    </div>
    <div class="editor-field">
        <%:Html.ListBox("Interests")%> 
        <%= Html.ValidationMessageFor(model => model.Interests)%> 
    </div> 

<div style="float: right;">
    <input id="button1" type="submit" value="Continue"/>
</div>
        </fieldset>

<script type="text/javascript" language="javascript">
    $(function () {
        $("#Passion").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: "/home/findinterests", type: "POST", dataType: "json",
                    data: { searchText: request.term, maxResults: 10 },
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item.Name, value: item.Name, id: item.Id }
                        }))
                    }
                })
            }
        });
    });
</script>